app.controller('roleViewAuthController', ['$scope', 'httpWrapService', 'dialogs', '$state', '$stateParams','$anchorScroll', 
                function ($scope, httpWrapService, dialogs, $state, $stateParams, $anchorScroll) {
    $scope.entity = {};

    $scope.id = $stateParams.id;

	httpWrapService.post('system/role/viewAuth/'+ $scope.id +'.do',{}).then(function(res2){
		$scope.auths = res2.data.data;
		
		var inter = setInterval(function(){
			if($.fn.zTree) {
				clearInterval(inter);
				var treeObj = $.fn.zTree.getZTreeObj("authViewtree");
				treeObj.expandAll(true);
			}
		}, 100)
    }); 
	
	$scope.setting = {
		callback : {
			onClick: function (event, treeId, treeNode, clickFlag) {
            }
		}
	}


}]);
